/*
 * Copyright (c) 2006-2021, RT-Thread Development Team
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2018-11-06     SummerGift   change to new framework
 * 2019-01-12     whj          add stm32f107-uc-Eval bsp
 */

#include <rtthread.h>
#include <rtdevice.h>
#include <board.h>
#include "applications.h"
#include "set_sram_224k.h"


void extend_sram(void)
{
  /* check if ram has been set to expectant size, if not, change eopb0 */
  if(((USD->eopb0) & 0xFF) != EXTEND_SRAM)
  {
    HAL_FLASH_Unlock();
    /* erase user system data bytes */
    flash_user_system_data_erase();

    /* change sram size */
    flash_user_system_data_program((uint32_t)&USD->eopb0, EXTEND_SRAM);

    /* system reset */
    NVIC_SystemReset();
  }
}


int main(void)
{

    applications_init();

    return RT_EOK;
}
